using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using IceDog.WebApi.AnythingApi.Services;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;

namespace IceDog.WebApi.AnythingApi
{
    /// <summary>
    /// 
    /// </summary>
    public class Program
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="args"></param>
        public static void Main(string[] args)
        {

            //for (int i = 0; i < 3; i++)
            //{
            //    TimerService.AddAndStart(new TimerExecuter<int>()
            //    {
            //        Interval = 1000,
            //        IsHeading = false,
            //        ArgsData = i,
            //        Action = (args) =>
            //        {
            //            Console.WriteLine($"running i:{i} args:{args}");
            //        },
            //        OnlyOnce = false
            //    });
            //}
            CreateHostBuilder(args).Build().Run();
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="args"></param>
        /// <returns></returns>
        public static IHostBuilder CreateHostBuilder(string[] args) =>
            Host.CreateDefaultBuilder(args)
                .ConfigureWebHostDefaults(webBuilder =>
                {
                    webBuilder.UseUrls("http://0.0.0.0:8200");
                    webBuilder.UseStartup<Startup>();
                });
    }
}
